package GtfsFile;

# A GTFS file definition, for generation ORM scaffolding.
$GtfsFile::VERSION = 0.01;

use strict; 
use warnings;

### OO METHODS
sub new {
	my $class = shift;

  my (%self) = @_;	

	$self{file} = "UNKNOWN'" unless $self{file};
	$self{class} = "UNKNOWN'" unless $self{class};
	$self{pfx} = "UNKNOWN'" unless $self{pfx};

  my @fields = ();
	$self{fields} = \@fields unless $self{fields};

	#### cast the spell
  return bless(\%self, $class);
}

sub file {
    my $self = shift;
    if(scalar @_ > 0) {
      $self->{file}  = shift;
    } 
    return $self->{file};
}

sub class {
    my $self = shift;
    if(scalar @_ > 0) {
      $self->{class}  = shift;
    } 
    return $self->{class};
}

sub pfx {
    my $self = shift;
    if(scalar @_ > 0) {
      $self->{pfx}  = shift;
    } 
    return $self->{pfx};
}


sub fields {
    my $self = shift;
    return $self->{fields};
}

sub addField {
    my ($self,$field) = @_;
    #print "addField:" . ref($field) . "\n";
    push($self->fields(), $field);
}

1;


__END__


